package com.wang.myblog.mapper;

import com.wang.myblog.entity.Article;
import com.wang.myblog.entity.ArticleTag;
import com.wang.myblog.entity.Tag;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface ArticleTagMapper {

    int insert(ArticleTag articleTag);

    int deleteById(Integer articleId);

    List<ArticleTag> queryAll(ArticleTag articleTag);

    Integer getArticleCount(Integer id);

    Integer getArticleCountByStatus(@Param("id") Integer id,@Param("status") Integer status);

    List<Tag> queryByArticleId(Integer id);

    Tag queryByArticleIdAndTagId(@Param("articleId") Integer articleId,@Param("tagId") Integer tagId);

    int deleteByTagId(Integer tagId);

    List<Article> queryArticleById(Integer tagId);

}
